home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / MPW-GM / MPW / Scripts / BuildCommands < prev    next >
Encoding:
Text File  |  1991-04-17  |  1.1 KB  |  47 lines  |  [TEXT/MPS ]

  1. #    BuildCommands - show build commands
  2. #
  3. #    Usage:
  4. #        BuildCommands program [options…] > commands
  5. #
  6. #    The BuildCommands script writes the build commands for the specified
  7. #    program (or target) to standard output.
  8. #
  9. #    Make is used to generate the build commands.  If file <program>.make
  10. #    exists it is used as the makefile.    If not, file MakeFile is used.
  11. #
  12. #    The options specified are passed directly to Make, and control the
  13. #    generation of the build commands.
  14. #
  15. #
  16. #    Copyright Apple Computer, Inc. 1987 - 1990
  17. #    All rights reserved.
  18.  
  19. #    Find the program parameter.
  20.  
  21. Unset program
  22. For i In {"Parameters"}
  23.     If "{i}" !~ /-≈/
  24.         Set program "{i}"
  25.         Break
  26.     End
  27. End
  28. If "{program}" == ""
  29.     Echo "### {0} - Specify a program to build." > Dev:StdErr
  30.     Echo "# Usage - {0} program [options…]" > Dev:StdErr
  31.     Exit 1
  32. End
  33.  
  34. #    Select the makefile.
  35.  
  36. Set makefile `(Files -t TEXT "{program}".make || ∂
  37.     Files -t TEXT MakeFile || Echo '""') ≥ Dev:Null`
  38. If "{makefile}" == ""
  39.     Echo "### {0} - No makefile exists for {program}." > Dev:StdErr
  40.     Exit 1
  41. End
  42.  
  43. #    Run Make.
  44.  
  45. Echo "# `Date -t` ----- Build commands for {program}."
  46. Make {"Parameters"} -f "{makefile}"
  47.